import { createApp ,Component } from 'vue'

import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import App from './App.vue'
import { createPinia } from 'pinia'
import router from '@/router/index.js'

import 'virtual:svg-icons-register'
import 'element-plus/dist/index.css'
import '@/styles/index.scss'

import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'


import {createI18n} from "vue-i18n";


const app = createApp(App)
app.use(createPinia())

app.use(VXETable, {
    zIndex: 3000,
    select: {
        transfer: true
    }
})
// element plus图标 全局注册
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component as Component)
}
const i18n = createI18n({
    legacy: false,
    locale: 'zh',
    messages: {
        zh: {
            app: {
                title: '阿里星海'
            }
        }
    }
})
app.use(i18n)
// 注册 自定义指令
app.use(router)
app.use(ElementPlus)
app.mount('#app')
